package com.sohh.demo.demo0522;

import java.util.ArrayList;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

/**
 * @description:
 * @author: ruoan
 * @date: 2021/5/16 15:57
 */
public class Test12 {

    public static void main(String[] args) {
        List<Integer> collect = IntStream.range(1, 10).boxed().collect(Collectors.toList());
        List<Integer> collect1 = IntStream.range(10, 20).boxed().collect(Collectors.toList());

        List<List<Integer>> lists = new ArrayList<>();
        lists.add(collect);
        lists.add(collect1);
        ArrayList<Integer> collect2 = lists.stream().collect(ArrayList::new, ArrayList::addAll, ArrayList::addAll);

        //BiConsumer<T, U> biConsumer = ArrayList::addAll;
        //ArrayList<Integer> collect3 = lists.stream().collect(new Collector<List<Integer>, Object, ArrayList<Integer>>() {});

        System.out.println(collect2);


    }



}
